home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 11 / FM Towns Free Software Collection 11.iso / t_os / lib / yotpin / src / otome_pi.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-22  |  2.9 KB  |  111 lines

  1. #pragma off(Optimize_for_space);
  2.  
  3. #define PI_MALLOC( size )    ((char *)pi_data->func1(size))
  4. #define PI_FREE( buf )        (pi_data->func2(buf))
  5. #define PI_FNAME            (pi_data->fname)
  6. #define PI_COMMENT            (pi_data->comment)
  7. #define    PI_DS                (pi_data->ds)
  8. #define PI_FORECOL    (pi_data->fore_color)
  9. #define PI_BACKCOL    (pi_data->back_color)
  10. #define    PI_TILEFLG    (pi_data->til_mode)
  11. #define    PI_USE_TILE    1
  12.  
  13. #define    PI_TILE_X    (pi_data->til_size.x)
  14. #define    PI_TILE_Y    (pi_data->til_size.y)
  15. #define    PI_TILE_PAT    (pi_data->tilPtn)
  16.  
  17. #define    PI_PAGE        (pi_imge->page)
  18. #define    PI_PIX        (pi_imge->pix)
  19. #define    PI_IMAGEBUF    (pi_imge->image)
  20. #define    PI_MASKBIT    (pi_imge->edit)
  21. #define    PI_COLMAP    (pi_imge->clut)
  22. #define    PI_SIZE        (pi_imge->size)
  23. #define    PI_SIZE_X    (pi_imge->size.x)
  24. #define    PI_SIZE_Y    (pi_imge->size.y)
  25.  
  26.  
  27. const char shortname[] = "OT";
  28.  
  29. PI_TYPE        *pi_type;
  30. PI_DATA        *pi_data;
  31. PI_IMAGE    *pi_imge;
  32. PI_PARA        *pi_para;
  33. FRAME        *ret_fr;                        /* 画像転送範囲            */
  34. char        *EgbPtr;
  35. char        *g_para;
  36.  
  37. #ifndef    USE_ENV
  38. #define    USE_ENV    PI_NOSET_ENV
  39. #endif
  40.  
  41. #ifndef    USE_PEN
  42. #define    USE_PEN    PI_SYS_PEN
  43. #endif
  44.  
  45. #ifdef    USE_FILE
  46. #define    USE_TYPE    USE_FILE
  47. #endif
  48.  
  49. int pinHead(int service, void *arg1, void *arg2, void *arg3, void *arg4)
  50. {
  51.     int        ret = 0;
  52.     
  53.     ret = 0;
  54.     switch (service) {
  55.     case 0:                                            /* 正式名称            */
  56.         strcpy((char *)arg1, longname);
  57.         break;
  58.     case 1:                                            /* 省略名称            */
  59.         strcpy((char *)arg1, shortname);
  60.         break;
  61.     case 2:                                            /* 初期化            */
  62.         pi_type = (PI_TYPE *)arg1;
  63.         strcpy((* pi_type).name, longname);            /* モジュール名        */
  64.         (* pi_type).type = USE_TYPE;                /* Type                */
  65.         (* pi_type).env1 = USE_ENV;                    /* 環境設定フラグ    */
  66.         
  67. #if        USE_TYPE == PI_DRAW_STAMP
  68.         (* pi_type).env2 = (int )&stamp;            /* スタンプ:サイズ    */
  69. #elif    defined(USE_FILE)
  70.         (* pi_type).env2 = (int )&extend;            /* ファイル系:拡張子*/
  71. #else
  72.         (* pi_type).env2 = USE_PEN;                    /* 描画系:ペン指定    */
  73. #endif
  74.         
  75. #ifdef    USE_SETUP_FUNC
  76.         USE_SETUP_FUNC();
  77. #endif
  78.         break;
  79.     case 3:                                            /* 実行                */
  80.         /*--------------------------------------------------------------*/
  81.         /* 必要なパラメタをコピーしておく                                */
  82.         /*--------------------------------------------------------------*/
  83.         pi_data = (PI_DATA *)arg1;
  84.         pi_imge = (PI_IMAGE *)arg2;
  85.         pi_para = (PI_PARA *)arg3;
  86.         ret_fr  = (FRAME *)arg4;
  87.         if( (* pi_para).type != USE_TYPE )    //  形式の確認
  88.             break;
  89.         g_para  = (* pi_para).gpara;
  90.         EgbPtr  = pi_imge->egbWork;
  91.         /*--------------------------------------------------------------*/
  92.         /* 実行部の呼び出し(パラメタ形式は自由)                            */
  93.         /*--------------------------------------------------------------*/
  94.         ret = APL_exec();
  95.         
  96.         break;
  97.     case 4:                                            /* 終了                */
  98.         break ;
  99.     case 5:                                            /* データ            */
  100. #if USE_ENV
  101.         *((int *)arg1) = cnfg_max;                    //  データ数
  102.         *((int *)arg2) = (int)cnfg;                    //  データアドレス
  103. #endif
  104.         break;
  105.     }
  106.     
  107.     return ret;
  108. }
  109. void main(){}
  110.  
  111.